package com.ss.android.account.model;

import com.ss.android.common.AbsApiThread;
import com.ss.android.image.model.ImageInfo;
import java.io.Serializable;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class SpipeUser extends BaseUser implements Serializable {
    public List mAuthorBadges;
    public String mAvatarUrl;
    public long mCreateTime;
    public String mDescription;
    public int mFanCount;
    public int mFollowCount;
    public int mIsNew;
    public Boolean mIsSnsFriend;
    public String mLastUpdate;
    public int mLikeCount;
    public String mMobileHash;
    public String mName;
    public String mPlatform;
    public String mPlatformScreenName;
    public String mReason;
    public String mScreenName;
    public boolean mShowSpringFestivalIcon;
    public String mSpringFestivalScheme;
    public int mSubscribeCount;
    public Boolean mUserVerified;
    public String mVerifiedAgency;
    public String mVerifiedContent;

    public SpipeUser(long arg4) {
        super(arg4);
        this.mCreateTime = -1;
        this.mUserVerified = null;
        this.mIsNew = -1;
        this.mFollowCount = 0;
        this.mFanCount = 0;
        this.mSubscribeCount = 0;
        this.mLikeCount = 0;
        this.mIsSnsFriend = Boolean.valueOf(false);
        this.mIsNew = 0;
    }

    public static SpipeUser parseUser(JSONObject arg10) throws JSONException {
        SpipeUser v0;
        long v8 = 0;
        int v5 = -1;
        SpipeUser v3 = null;
        if(arg10 == null) {
            v0 = v3;
        }
        else {
            long v6 = arg10.optLong("user_id", v8);
            if(v6 <= v8) {
                v0 = v3;
            }
            else {
                SpipeUser v4 = new SpipeUser(v6);
                v4.mShowSpringFestivalIcon = AbsApiThread.optBoolean(arg10, "show_spring_festival_icon", false);
                v4.mAuthorBadges = ImageInfo.optImageList(arg10, "author_badge", true);
                v4.mSpringFestivalScheme = arg10.optString("spring_festival_scheme");
                v4.mCreateTime = arg10.optLong("create_time", -1);
                v4.mName = arg10.optString("name", ((String)null));
                v4.mScreenName = arg10.optString("screen_name", ((String)null));
                v4.mDescription = arg10.optString("description", ((String)null));
                v4.mAvatarUrl = arg10.optString("avatar_url", ((String)null));
                if(android.support.design.a.isTextEmpty(v4.mAvatarUrl)) {
                    v4.mAvatarUrl = arg10.optString("user_profile_image_url", ((String)null));
                }

                v4.extractIsFollowing(arg10);
                v4.extractIsFollowed(arg10);
                if(arg10.has("type")) {
                    boolean v0_1 = arg10.optInt("type") == 1 ? true : false;
                    v4.mIsSnsFriend = Boolean.valueOf(v0_1);
                }

                v4.mLastUpdate = arg10.optString("last_update", ((String)null));
                if(arg10.has("display_info")) {
                    v4.mLastUpdate = arg10.optString("display_info", ((String)null));
                }

                if(arg10.has("user_verified")) {
                    v4.mUserVerified = Boolean.valueOf(arg10.optBoolean("user_verified"));
                }

                v4.mVerifiedContent = arg10.optString("verified_content", ((String)null));
                v4.mPlatform = arg10.optString("platform", ((String)null));
                v4.mPlatformScreenName = arg10.optString("platform_screen_name", ((String)null));
                v4.mReasonType = arg10.optInt("reason_type", v5);
                v4.mReason = arg10.optString("recommend_reason", ((String)null));
                v4.mIsNew = arg10.optInt("is_newer", v5);
                v4.mMobileHash = arg10.optString("mobile_hash", ((String)null));
                v4.extractIsBlocked(arg10);
                v4.extractIsBlocking(arg10);
                v4.extractMessageUserId(arg10);
                v4.mFollowCount = arg10.optInt("followings_count", 0);
                v4.mFanCount = arg10.optInt("followers_count", 0);
                v4.mSubscribeCount = arg10.optInt("pgc_like_count", 0);
                v4.mLikeCount = arg10.optInt("entity_like_count", 0);
                v4.mVerifiedAgency = arg10.optString("verified_agency", ((String)null));
                v4.setIsParsed(true);
                v0 = v4;
            }
        }

        return v0;
    }

    public void updateFields(SpipeUser arg5) {
        super.updateFields(((BaseUser)arg5));
        String v0 = arg5.mAvatarUrl != null ? arg5.mAvatarUrl : this.mAvatarUrl;
        this.mAvatarUrl = v0;
        v0 = arg5.mScreenName != null ? arg5.mScreenName : this.mScreenName;
        this.mScreenName = v0;
        v0 = arg5.mName != null ? arg5.mName : this.mName;
        this.mName = v0;
        long v0_1 = arg5.mCreateTime > 0 ? arg5.mCreateTime : this.mCreateTime;
        this.mCreateTime = v0_1;
        Boolean v0_2 = arg5.mUserVerified != null ? arg5.mUserVerified : this.mUserVerified;
        this.mUserVerified = v0_2;
        v0 = arg5.mDescription != null ? arg5.mDescription : this.mDescription;
        this.mDescription = v0;
        v0 = arg5.mVerifiedContent != null ? arg5.mVerifiedContent : this.mVerifiedContent;
        this.mVerifiedContent = v0;
        v0_2 = arg5.mIsSnsFriend != null ? arg5.mIsSnsFriend : this.mIsSnsFriend;
        this.mIsSnsFriend = v0_2;
        v0 = arg5.mLastUpdate != null ? arg5.mLastUpdate : this.mLastUpdate;
        this.mLastUpdate = v0;
        v0 = arg5.mPlatform != null ? arg5.mPlatform : this.mPlatform;
        this.mPlatform = v0;
        v0 = arg5.mPlatformScreenName != null ? arg5.mPlatformScreenName : this.mPlatformScreenName;
        this.mPlatformScreenName = v0;
        int v0_3 = arg5.mIsNew >= 0 ? arg5.mIsNew : this.mIsNew;
        this.mIsNew = v0_3;
        v0 = arg5.mReason != null ? arg5.mReason : this.mReason;
        this.mReason = v0;
        v0 = arg5.mMobileHash != null ? arg5.mMobileHash : this.mMobileHash;
        this.mMobileHash = v0;
        v0_3 = arg5.mFollowCount >= 0 ? arg5.mFollowCount : this.mFollowCount;
        this.mFollowCount = v0_3;
        v0_3 = arg5.mFanCount >= 0 ? arg5.mFanCount : this.mFanCount;
        this.mFanCount = v0_3;
        v0_3 = arg5.mSubscribeCount >= 0 ? arg5.mSubscribeCount : this.mSubscribeCount;
        this.mSubscribeCount = v0_3;
        v0_3 = arg5.mLikeCount >= 0 ? arg5.mLikeCount : this.mLikeCount;
        this.mLikeCount = v0_3;
        v0 = arg5.mVerifiedAgency != null ? arg5.mVerifiedAgency : this.mVerifiedAgency;
        this.mVerifiedAgency = v0;
        this.mShowSpringFestivalIcon = arg5.mShowSpringFestivalIcon;
        this.mAuthorBadges = arg5.mAuthorBadges;
        this.mSpringFestivalScheme = arg5.mSpringFestivalScheme;
    }
}

